#ifndef _ATTRIBUTE_H_
#define _ATTRIBUTE_H_
#include "ast/exprType.h"
#include "ast/NameTok.h"
#include "ast/exprContextType.h"
class IVisitor;
class Attribute;
typedef QSharedPointer<Attribute> AttributePtr;

class Attribute: public exprType
{
public:
    explicit Attribute(const exprTypePtr& value, const NameTokPtr& attr, int ctx, int nodeId=-1);
    virtual ~Attribute();
    
    
    exprTypePtr value();
    void setValue(const exprTypePtr& value);
    
    NameTokPtr attr();
    void setAttr(const NameTokPtr& attr);
    
    int ctx();
    void setCtx(int ctx);
    
    
    virtual QString type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
    exprTypePtr _value;
    NameTokPtr _attr;
    int _ctx;
};




#endif